package com.ehotting.edsta.csharpServer.controller;

import com.ehotting.eaf.core.domain.R;
import com.ehotting.eaf.core.web.controller.BaseController;
import com.ehotting.edsta.common.log.annotation.Log;
import com.ehotting.edsta.common.log.enums.BusinessType;
import com.ehotting.edsta.csharpServer.service.ISysDictDataService;
import com.ehotting.eaf.core.domain.system.api.SysDictData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 数据字典信息
 * 
 * @author edsta
 */
@RestController
@RequestMapping("/dict/data")
@Api(tags = "SysDictDataController",description = "数据字典信息")
public class SysDictDataController extends BaseController
{
    @Autowired
    private ISysDictDataService dictDataService;

    @Log(title = "数据字典信息",businessType = BusinessType.GET_DATA)
    @ApiOperation("根据数据字典类型，获取所有的字典数据")
    @GetMapping("/listAll")
    public R<List<SysDictData>> list(String dictType) {
        return R.ok(dictDataService.selectDictDataList(dictType));
    }
}
